{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>百度页面跳转</title>
    <script src="{% static 'assets/vendors/jquery-3.1.1.min.js' %}" type="text/javascript"></script>
    <script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.js" type="text/javascript"></script>
    <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
</head>
<body>
<script type="text/javascript">
    $(document).ready(function () {
        var token = $.cookie('csrftoken');
        console.log(returnCitySN);
        $.ajax({
            url: "{% url 'managersys:pv_counter' %}",
            type: "POST",
            data: {"ip_address": returnCitySN["cip"], "ip_city": returnCitySN["cname"], "city_id": returnCitySN["cid"]},
            headers: {'X-CSRFToken': token},
            dataType: "json",
            success: function (data) {
                console.log(data);
                if (data['status'] === 200) {
                    window.location.href = "http://www.baidu.com/";
                }
            },
            error: function (e) {
                console.log(e);
            }
        });
    });
</script>
</body>
</html>